/*--------------------------------------------------------------------------------------+
|
|     $Source: samples/SampleDgnDbEditor/PlaceShipping%Class%Tool.h $
|
|  $Copyright: (c) 2014 Bentley Systems, Incorporated. All rights reserved. $
|
+--------------------------------------------------------------------------------------*/
#pragma once
#include "SampleDgnDbEditor.h"

//=======================================================================================
// Sample tool that places a shipping %ClassDown%
// @bsiclass                                                BentleySystems
//=======================================================================================
struct PlaceShipping%Class%Tool : public DgnPlatform::DgnPrimitiveTool
{
    DEFINE_T_SUPER (DgnPlatform::DgnPrimitiveTool)

private:
    DgnModelR m_writeModel;
    DSegment3d m_segment;
    int m_numPoints;
    StandaloneECInstancePtr m_itemPtr;

    Transform CalculateLocalToWorldTransform();
    double CalculateLength();

protected:
    virtual Utf8CP _GetToolId () const override {return SampleDgnDbEditorApp::TOOLID_PlaceShipping%Class%();}
    virtual void _OnPostInstall() override;
    virtual void _OnRestartTool() override;
    virtual bool _OnDataButton (DgnButtonEventCP) override;
    virtual bool _OnDataButtonUp (DgnButtonEventCP) override;
    virtual bool _OnResetButton (DgnButtonEventCP) override;
    virtual bool _OnModelStartDrag (DgnButtonEventCP) override;
    virtual bool _OnModelEndDrag (DgnButtonEventCP) override;
    virtual bool _OnModelMotion (DgnButtonEventCP) override;
    virtual void _OnDynamicFrame (DgnButtonEventCP) override;

public:
    PlaceShipping%Class%Tool (DgnModelR);
};
